function rest = randouwdt(t,~,T,a,b,m,sig0,betaK,sig,s,IIpart)


sigmavalue=[sig.sigma0(t,T,a,m,sig0),...
    sig.sigma1(t,T,a,b),sig.sigma2(t,T,a,b),sig.sigma3(t,T,a,b),sig.sigma4(t,T,a,b),sig.sigma5(t,T,a,b),...
    sig.sigma6(t,T,a,b),sig.sigma7(t,T,a,b),sig.sigma8(t,T,a,b),sig.sigma9(t,T,a,b),sig.sigma10(t,T,a,b),...
    sig.sigma11(t,T,a,b),sig.sigma12(t,T,a,b),sig.sigma13(t,T,a,b),sig.sigma14(t,T,a,b),sig.sigma15(t,T,a,b),...
    sig.sigma16(t,T,a,b),sig.sigma17(t,T,a,b),sig.sigma18(t,T,a,b),sig.sigma19(t,T,a,b),sig.sigma20(t,T,a,b),...
    sig.sigma21(t,T,a,b),sig.sigma22(t,T,a,b),sig.sigma23(t,T,a,b),sig.sigma24(t,T,a,b),sig.sigma25(t,T,a,b)];
wvalue=[s.w1(t,T),s.w2(t,T),s.w3(t,T),s.w4(t,T),s.w5(t,T),...
    s.w6(t,T),s.w7(t,T),s.w8(t,T),s.w9(t,T),s.w10(t,T),...
    s.w11(t,T),s.w12(t,T),s.w13(t,T),s.w14(t,T),s.w15(t,T),...
    s.w16(t,T),s.w17(t,T),s.w18(t,T),s.w19(t,T),s.w20(t,T),...
    s.w21(t,T),s.w22(t,T),s.w23(t,T),s.w24(t,T),s.w25(t,T),...
    s.w26(t,T),s.w27(t,T),s.w28(t,T),s.w29(t,T),s.w30(t,T),...
    s.w31(t,T),s.w32(t,T),s.w33(t,T),s.w34(t,T),s.w35(t,T),...
    s.w36(t,T),s.w37(t,T),s.w38(t,T),s.w39(t,T),s.w40(t,T),...
    s.w41(t,T),s.w42(t,T),s.w43(t,T),s.w44(t,T),s.w45(t,T),...
    s.w46(t,T),s.w47(t,T),s.w48(t,T),s.w49(t,T),s.w50(t,T)];
rest=zeros(1+2*betaK+(betaK-1)*betaK/2,1);
rest(1)=sum(sigmavalue(2:betaK+1).*wvalue(1:betaK));
rest(2:betaK+1)=sigmavalue(1)*wvalue(1:betaK);
rest(betaK+2:2*betaK+1)=sqrt(2)*sigmavalue(2:betaK+1).*wvalue(1:betaK);
for ii=1:betaK*(betaK-1)/2
    curindex=find(IIpart(ii,:)==1);
    rest(2*betaK+1+ii)=sigmavalue(curindex(1)+1)*wvalue(curindex(2))+sigmavalue(curindex(2)+1)*wvalue(curindex(1));
end
